package com.vegas.netspider.apps.task;

import java.util.List;

import com.vegas.netspider.apps.parser.WebParser;
import com.vegas.netspider.cache.NoteCacheRoom;
import com.vegas.netspider.dto.SportNote;

public class NoteNetDataLoader extends NetDataLoaderProxyer{

	private String url;
	
	private WebParser<List<SportNote>> parser;
	
	private NoteCacheRoom cache;
	
	public void loadNote() throws Exception{
		String res = this.load(url);
		List<SportNote> list = parser.parse(res);
		if(list==null||list.isEmpty()){
			return;
		}
		
		cache.push(list);
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public void setParser(WebParser<List<SportNote>> parser) {
		this.parser = parser;
	}

	public void setCache(NoteCacheRoom cache) {
		this.cache = cache;
	}
	
	
	
}
